PATHMac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Window Manager >

Programming With the Mac OS 8.5 Window Manager


Window Definition Message Constants

With the Mac OS 8.5 Window Manager, the Window Manager may pass one of the following constants in the message parameter of your window definition function to specify the action that your function must perform. For descriptions of the feature bits that correspond to these messages, See Window Definition Feature Constants. For other window definition message constants, see "Defining Your Own Window Definition Function" in Mac OS 8 Window Manager Reference .

enum {
    kWindowMsgDragHilite            = 9,
    kWindowMsgModified              = 10,
    kWindowMsgDrawInCurrentPort     = 11,
    kWindowMsgSetupProxyDragImage   = 12,
    kWindowMsgStateChanged          = 13,
    kWindowMsgMeasureTitle          = 14
};

Constant descriptions

kWindowMsgDragHilite
Redraw the window's structure region to reflect the window's validity as a drag-and-drop destination. The Window Manager passes an accompanying Boolean value in your window definition function's param parameter. If the value passed is true , this indicates that the window's structure region should be highlighted. If the value passed is false , the structure region should be unhighlighted. Your window definition function should return 0 as the function result.
kWindowMsgModified
Track the window's modification state. The Window Manager sends this message when the function SetWindowModified is called. The Window Manager passes an accompanying Boolean value in your window definition function's param parameter. If the value passed is true , the document contained in the window has been modified. If the value passed is false , the document has been saved to disk. You should redraw the window's structure region to reflect the new modification state, if appropriate. For example, system-defined document windows dim the proxy icon to indicate that the document has been modified by the user and cannot be moved at that time. Your window definition function should return 0 as the function result.
kWindowMsgDrawInCurrentPort
Draw the window's frame in the current graphics port. Other than restricting drawing to the current port, this message is similar to the pre-Mac OS 8.5 Window Manager window definition message constant wDraw . See "Drawing the Window Frame" in the "Defining Your Own Window Definition Function" section of Mac OS 8 Window Manager Reference for more details on what to do when passed this message.
kWindowMsgSetupProxyDragImage
Create the image of the window's proxy icon that the Drag Manager uses to represent the icon while it is being dragged. When your application calls the function TrackWindowProxyDrag , the Window Manager passes this message in your window definition function's message parameter and an accompanying pointer to a structure of type SetupWindowProxyDragImageRec in the param parameter. Your window definition function is responsible for setting the contents of the structure to contain the data describing the proxy icon's drag image. Your window definition function should return 0 as the function result.
kWindowMsgStateChanged
Be informed that some aspect of the window's public state has changed. The Window Manager passes this message in your window definition function's message parameter and an accompanying flag in the param parameter that indicates what part of the window's state has been altered. This message is simply a notification message--no response by the window definition function is required. Your window definition function should return 0 as the function result. The kWindowMsgStateChanged message is sent after the window's internal data has been updated, but before any redraw occurs onscreen. A window definition function should not redraw the window frame in response to this message. If it is necessary to redraw the window frame, the Window Manager notifies the window definition function with a wDraw message. See Window Definition State-Changed Constant for descriptions of the values that the Window Manager can pass to specify the state change that has occurred.
kWindowMsgMeasureTitle
Measure and return the ideal title width. The Window Manager passes this message in the window definition function's message parameter and an accompanying pointer to a structure of type MeasureWindowTitleRec in the param parameter. Your window definition function is responsible for setting the contents of the structure to contain data describing the title width. You should return 0 as the function result.

© 1999 Apple Computer, Inc. – (Last Updated 18 March 99)